package com.xbongbong.saas.domain.entity;

import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.toolbox.util.DateTimeUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * @author WangJian
 * @date  2019-01-25 10:58
 **/
@Getter
@Setter
@ToString
public class SupplierProductEntity implements Serializable {

    private static final long serialVersionUID = 5986426221969865118L;
    /**
     * 主键
     */
    private Long id;
    /**
     * 公司id
     */
    private String corpid;
    /**
     * 供应商id
     */
    private Long supplierId;
    /**
     * 供应商name
     */
    private String supplierName;
    /**
     * 父产品id
     */
    private Long parentId;
    /**
     * 产品id
     */
    private Long productId;

    /**
     * 创建时间

     */
    private Long addTime;
    /**
     * 更新时间
     */
    private Long updateTime;
    /**
     * 删除标识
     */
    private Integer del;
    /**
     * 产品展示排序
     */
    private Integer sort;

    private JSONObject data;

    private String unit;

    private String childIds;

    public SupplierProductEntity() {
        this.addTime = DateTimeUtil.getInt();
        this.updateTime = DateTimeUtil.getInt();
        this.del = 0;
    }

    public SupplierProductEntity(String corpid, Long supplierId, String supplierName, Long parentProductId, Long productId, Integer sort) {
        this.addTime = DateTimeUtil.getInt();
        this.updateTime = DateTimeUtil.getInt();
        this.del = 0;
        this.corpid = corpid;
        this.supplierId = supplierId;
        this.supplierName = supplierName;
        this.parentId = parentProductId;
        this.productId = productId;
        this.sort = sort;
        this.data = new JSONObject();
    }

    public SupplierProductEntity(String corpid, Long supplierId, String supplierName, Long parentProductId, Long productId, Integer sort, String unit) {
        this.addTime = DateTimeUtil.getInt();
        this.updateTime = DateTimeUtil.getInt();
        this.del = 0;
        this.corpid = corpid;
        this.supplierId = supplierId;
        this.supplierName = supplierName;
        this.parentId = parentProductId;
        this.productId = productId;
        this.sort = sort;
        this.data = new JSONObject();
        this.unit = unit;
    }


}
